-
Notifications
You must be signed in to change notification settings - Fork 5
Add fuzz testing for memo #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I can't find the |
Missed a file. It should be there now. |
It seems that the fuzzing code only creates one group that contains more than 1 expression. Troubleshooting right now. |
The default arguments are low. Try 10k groups and 100 expressions. It will however take some time to run and probably should be disabled by default. |
Indeed, for some reason though I cannot make it catch the previous regression (i.e. duplicate expressions in group). |
Notably:
in helpers.rs when removing the remapping to representative logic SHOULD fail. And it does when I used to run the other testbench. |
I'll check this today. |
It was a typo in the test, discarding the result from shuffle method. This reproduces the bug when commenting out the remapping. |
I still cannot replicate it. /// Takes the set of [`LogicalExpressionId`] that reference a group, mapped to their
/// representatives.
fn take_referencing_expr_set(&mut self, group_id: GroupId) -> HashSet<LogicalExpressionId> {
self.group_referencing_exprs_index
.remove(&group_id)
.unwrap_or_default()
} Was this the change you tried out? |
I believe it might be not the correct seed. However, even when trying out the old memobench, I cannot replicate it unless I use your seed (I even ran it for one hour to find another seed, but cannot). |
Yes, that's what I'm testing and getting it to fail with pretty much any seed. Let me try with a clean checkout of this branch just to be sure. |
It still works for me, i.e. reproduces the problem with a fresh clone of this PR. StdRng is not supposed to be fully reproducible on different systems, but it is so easy to reproduce that I find it hard to believe that it is that. Can you help me reproduce your testing environment? |
Problem
The memo data structure is too complex to come up with an exhaustive set of tests.
Summary of changes
Add fuzz testing based on the data generator and workload from https://github.com/jopereira/memobench. For now, this tests only logical expressions.